/**
*fieldNames 需要哪些字段 根据传入字段对应每类的值
*jsonData 生成table的数据   格式为json类型的数据
*lastColumnElement 如果table最后一列为操作列 需要加入按钮或者是删除工作等元素 格式为：<input type="button" value="按钮"> 
*/
function creatTable(fieldNames,page,lastColumnElement){
	var sHtml = "";
	if(page != null){
		if(page.data == null){
			return "";
		}
		var fields = new Array();
		var fieldsLength = 1;
		if(fieldNames != null){
			fields = fieldNames.split(",");
			fieldsLength = fields.length;
		}
		var dataLength = page.data.length;
		var dataList = page.data;
		var tdS = ""; var tdE = "";
		for(var i=0;i<dataLength;i++){
			sHtml = sHtml+ "<tr>";
			var tdStr = "";
			
			for(var j=0;j<fieldsLength;j++){
				for(var d in dataList[i]){
					var value = dataList[i][d];
					if(null==value){value="";}
					var bool = true;
					tdS = "<td>"; 
					tdE = "</td>";
					var strArray = new Array(); 
					var newFieldNames = "";
					
					if(fields[j].indexOf("</a>") > 0){
						newFieldNames = fields[j].substring(fields[j].indexOf('>')+1,fields[j].lastIndexOf('<'));
						strArray = fields[j].split(newFieldNames);
					}else if(fields[j].indexOf("@TDH") > 0){
						tdS = "<td style='display:none;'>";
						newFieldNames = fields[j].substring(0,fields[j].indexOf("@TDH"));
					}else{
						newFieldNames = fields[j];
					}
					if(fieldNames != null && newFieldNames.toLowerCase() == d.toLowerCase()){
						if(strArray != null && strArray.length == 2){
							sHtml = sHtml+tdS+strArray[0]+value+strArray[1]+tdE;
						}else{
							sHtml = sHtml+tdS+value+tdE;
						}
						bool = false;
					}else if(fieldNames == null){
						sHtml = sHtml+ "<td>"+value+"</td>";
					}
				}
			}

			
			if(null != lastColumnElement){
				var strArray2 = new Array(); 
				strArray2 = lastColumnElement.split("@");
				for(var z=0;z<strArray2.length;z++){
					sHtml = sHtml+ "<td>"+strArray2[z]+"</td>";
				}
						
			}
			sHtml = sHtml + tdStr + "</tr>";
		}
		
		
	}
	return sHtml;
}
/**
*fieldNames 需要哪些字段 根据传入字段对应每类的值
*jsonData 生成table的数据   格式为json类型的数据
*lastColumnElement 如果table最后一列为操作列 需要加入按钮或者是删除工作等元素 格式为：<input type="button" value="按钮"> 
*/
function creatTable1(fieldNames,page,firstColumnElement,lastColumnElement){
	var sHtml = "";
	if(page != null){
		if(page.data == null){
			return "";
		}
		var fields = new Array();
		var fieldsLength = 1;
		if(fieldNames != null){
			fields = fieldNames.split(",");
			fieldsLength = fields.length;
		}
		var dataLength = page.data.length;
		var dataList = page.data;
		var tdS = ""; var tdE = "";
		
		
		for(var i=0;i<dataLength;i++){
			sHtml = sHtml+ "<tr>";
			var tdStr = "";
			if(null != firstColumnElement){
				var strArray2 = new Array(); 
				var value = dataList[i]['TRADPRODCODE'];
				strArray2 = firstColumnElement.split("@");
				for(var z=0;z<strArray2.length;z++){
					var buttonr=strArray2[z];
					buttonr=buttonr.replace(/#/g,value);
					sHtml = sHtml+ "<td>"+buttonr+"</td>";
				}
			}
			for(var j=0;j<fieldsLength;j++){
				for(var d in dataList[i]){
					var value = dataList[i][d];
					if(null==value){value="";}
					var bool = true;
					tdS = "<td>"; 
					tdE = "</td>";
					var strArray = new Array(); 
					var newFieldNames = "";
					if(fields[j].indexOf("</a>") > 0){
						newFieldNames = fields[j].substring(fields[j].indexOf('>')+1,fields[j].lastIndexOf('<'));
						strArray = fields[j].split(newFieldNames);
					}else if(fields[j].indexOf("@TDH") > 0){
						tdS = "<td style='display:none;'>";
						newFieldNames = fields[j].substring(0,fields[j].indexOf("@TDH"));
					}else if(fields[j].indexOf("?") > 0){
						var fieldss=fields[j].split("?");
						var jsonStr=fieldss[1];
						jsonStr=jsonStr.replace(/;/g,",");
						var jsonV= eval('('+jsonStr+')');
						for(var e=0;e<jsonV.length;e++){
							for(var key in jsonV[e]){
								var jvalue = jsonV[e][key];
								if(value==key){
									value=jvalue;
								}
							}
						}
						newFieldNames=fieldss[0];
						
					}else{
						newFieldNames = fields[j];
					}
					if(fieldNames != null && newFieldNames.toLowerCase() == d.toLowerCase()){
						if(strArray != null && strArray.length == 2){
							sHtml = sHtml+tdS+strArray[0]+value+strArray[1]+tdE;
						}else{
							
							sHtml = sHtml+tdS+value+tdE;
						}
						bool = false;
					}else if(fieldNames == null){
						sHtml = sHtml+ "<td>"+value+"</td>";
					}
				}
			}

			
			if(null != lastColumnElement){
				var strArray2 = new Array(); 
				strArray2 = lastColumnElement.split("@");
				for(var z=0;z<strArray2.length;z++){
					var buttonr=strArray2[z];
					buttonr=buttonr.replace(/#/g,value);
					sHtml = sHtml+ "<td>"+buttonr+"</td>";
				}	
			}
			sHtml = sHtml + tdStr + "</tr>";
		}
		
		
	}
	return sHtml;
}
function creatTable2(fieldNames,page,firstColumnElement,lastColumnElement){
	var sHtml = "";
	if(page != null){
		if(page.data == null){
			return "";
		}
		var fields = new Array();
		var fieldsLength = 1;
		if(fieldNames != null){
			fields = fieldNames.split(",");
			fieldsLength = fields.length;
		}
		var dataLength = page.data.length;
		var dataList = page.data;
		var tdS = ""; var tdE = "";
		
		
		for(var i=0;i<dataLength;i++){
			sHtml = sHtml+ "<tr>";
			var tdStr = "";
			if(null != firstColumnElement){
				var strArray2 = new Array(); 
				var value = dataList[i]['TRADPRODCODE'];
				strArray2 = firstColumnElement.split("@");
				for(var z=0;z<strArray2.length;z++){
					var buttonr=strArray2[z];
					buttonr=buttonr.replace(/#/g,value);
					sHtml = sHtml+ "<td>"+buttonr+"</td>";
				}
			}
			for(var j=0;j<fieldsLength;j++){
				for(var d in dataList[i]){
					var value = dataList[i][d];
					if(null==value){value="";}
					var bool = true;
					tdS = "<td>"; 
					tdE = "</td>";
					var strArray = new Array(); 
					var newFieldNames = "";
					if(fields[j].indexOf("</a>") > 0){
						newFieldNames = fields[j].substring(fields[j].indexOf('>')+1,fields[j].lastIndexOf('<'));
						strArray = fields[j].split(newFieldNames);
					}else if(fields[j].indexOf("@TDH") > 0){
						tdS = "<td style='display:none;'>";
						newFieldNames = fields[j].substring(0,fields[j].indexOf("@TDH"));
					}else if(fields[j].indexOf("?") > 0){
						var fieldss=fields[j].split("?");
						var jsonStr=fieldss[1];
						jsonStr=jsonStr.replace(/;/g,",");
						var jsonV= eval('('+jsonStr+')');
						for(var e=0;e<jsonV.length;e++){
							for(var key in jsonV[e]){
								var jvalue = jsonV[e][key];
								if(value==key){
									value=jvalue;
								}
							}
						}
						newFieldNames=fieldss[0];
						
					}else{
						newFieldNames = fields[j];
					}
					if(fieldNames != null && newFieldNames.toLowerCase() == d.toLowerCase()){
						if(strArray != null && strArray.length == 2){
							sHtml = sHtml+tdS+strArray[0]+value+strArray[1]+tdE;
						}else{
							
							sHtml = sHtml+tdS+value+tdE;
						}
						bool = false;
					}else if(fieldNames == null){
						sHtml = sHtml+ "<td>"+value+"</td>";
					}
				}
			}

			
			if(null != lastColumnElement){
				var strArray2 = new Array(); 
				
				
				strArray2 = lastColumnElement.split("@");
				for(var z=0;z<strArray2.length;z++){
					var buttonr=strArray2[z];
					var flow=true;
					
					while(flow){
						var start=buttonr.indexOf("{");
						var end =buttonr.indexOf("}");
						var lastval=buttonr.substring(start+1,end);
						var value = dataList[i][lastval];
						if(start>0){
							if(null==value){
								buttonr=buttonr.replace("{"+lastval+"}","");
							}else{
								buttonr=buttonr.replace("{"+lastval+"}",value);
							}
						}else{
							flow=false;
						}
					}
					sHtml = sHtml+ "<td>"+buttonr+"</td>";
				}	
			}
			sHtml = sHtml + tdStr + "</tr>";
		}
		
		
	}
	return sHtml;
}
/**
 * 201806 lfd added
*fieldNames 需要哪些字段 根据传入字段对应每类的值
*jsonData 生成table的数据   格式为json类型的数据
*lastColumnFunction 如果table最后一列为操作列 传入获得最后一列内容的 function
*/
function creatTable4(fieldNames,page,firstColumnElement,lastColumnFunction){
	var sHtml = "";
	if(page != null){
		if(page.data == null){
			return "";
		}
		var fields = new Array();
		var fieldsLength = 1;
		if(fieldNames != null){
			fields = fieldNames.split(",");
			fieldsLength = fields.length;
		}
		var dataLength = page.data.length;
		var dataList = page.data;
		var tdS = ""; var tdE = "";
		
		
		for(var i=0;i<dataLength;i++){
			sHtml = sHtml+ "<tr>";
			var tdStr = "";
			if(null != firstColumnElement){
				var strArray2 = new Array(); 
				var value = dataList[i]['TRADPRODCODE'];
				strArray2 = firstColumnElement.split("@");
				for(var z=0;z<strArray2.length;z++){
					var buttonr=strArray2[z];
					buttonr=buttonr.replace(/#/g,value);
					sHtml = sHtml+ "<td>"+buttonr+"</td>";
				}
			}
			for(var j=0;j<fieldsLength;j++){
				for(var d in dataList[i]){
					var value = dataList[i][d];
					if(null==value){value="";}
					var bool = true;
					tdS = "<td>"; 
					tdE = "</td>";
					var strArray = new Array(); 
					var newFieldNames = "";
					if(fields[j].indexOf("</a>") > 0){
						newFieldNames = fields[j].substring(fields[j].indexOf('>')+1,fields[j].lastIndexOf('<'));
						strArray = fields[j].split(newFieldNames);
					}else if(fields[j].indexOf("@TDH") > 0){
						tdS = "<td style='display:none;'>";
						newFieldNames = fields[j].substring(0,fields[j].indexOf("@TDH"));
					}else if(fields[j].indexOf("?") > 0 && d == fields[j].split("?")[0]){
						var fieldss=fields[j].split("?");
						var jsonStr=fieldss[1];
						jsonStr=jsonStr.replace(/;/g,",");
						var jsonV= eval('('+jsonStr+')');
						for(var key in jsonV){
							var jvalue = jsonV[key];
							if(value==key){
								value=jvalue;
							}
						}
						newFieldNames=fieldss[0];
						
					}else{
						newFieldNames = fields[j];
					}
					if(fieldNames != null && newFieldNames.toLowerCase() == d.toLowerCase()){
						if(strArray != null && strArray.length == 2){
							sHtml = sHtml+tdS+strArray[0]+value+strArray[1]+tdE;
						}else{
							
							sHtml = sHtml+tdS+value+tdE;
						}
						bool = false;
					}else if(fieldNames == null){
						sHtml = sHtml+ "<td>"+value+"</td>";
					}
				}
			}

			if(null != lastColumnFunction){
				var buttonr = lastColumnFunction(dataList[i]) 
				sHtml = sHtml+ "<td>"+buttonr+"</td>";
			}
			
			sHtml = sHtml + tdStr + "</tr>";
		}
		
		
	}
	return sHtml;
}
/**
 * 为指定表格添加行
 * table_id:表格id
 * table_max_row_num:当前最大行号是多少
 */

function creatTable5(fieldNames,page,firstColumnElement,lastColumnElement){
	var sHtml = "";
	if(page != null){
		if(page.data == null){
			return "";
		}
		var fields = new Array();
		var fieldsLength = 1;
		if(fieldNames != null){
			fields = fieldNames.split(",");
			fieldsLength = fields.length;
		}
		var dataLength = page.data.length;
		var dataList = page.data;
		var tdS = ""; var tdE = "";
		
		
		for(var i=0;i<dataLength;i++){
			sHtml = sHtml+ "<tr ondbclick='showDetail(this)'>";
			var tdStr = "";
			if(null != firstColumnElement){
				var strArray2 = new Array(); 
				var value = dataList[i]['TRADPRODCODE'];
				strArray2 = firstColumnElement.split("@");
				for(var z=0;z<strArray2.length;z++){
					var buttonr=strArray2[z];
					buttonr=buttonr.replace(/#/g,value);
					sHtml = sHtml+ "<td>"+buttonr+"</td>";
				}
			}
			for(var j=0;j<fieldsLength;j++){
				for(var d in dataList[i]){
					var value = dataList[i][d];
					if(null==value){value="";}
					var bool = true;
					if(j==0){
						tdS = "<td ondblclick='showDetail(this)' style='cursor: pointer;'>"; 
						tdE = "</td>";	
					}else{
						tdS = "<td ondblclick='showDetail(this)'>"; 
						tdE = "</td>";	
					}
					var strArray = new Array(); 
					var newFieldNames = "";
					if(fields[j].indexOf("</a>") > 0){
						newFieldNames = fields[j].substring(fields[j].indexOf('>')+1,fields[j].lastIndexOf('<'));
						strArray = fields[j].split(newFieldNames);
					}else if(fields[j].indexOf("@TDH") > 0){
						tdS = "<td style='display:none;'>";
						newFieldNames = fields[j].substring(0,fields[j].indexOf("@TDH"));
					}else if(fields[j].indexOf("?") > 0){
						var fieldss=fields[j].split("?");
						var jsonStr=fieldss[1];
						jsonStr=jsonStr.replace(/;/g,",");
						var jsonV= eval('('+jsonStr+')');
						for(var e=0;e<jsonV.length;e++){
							for(var key in jsonV[e]){
								var jvalue = jsonV[e][key];
								if(value==key){
									value=jvalue;
								}
							}
						}
						newFieldNames=fieldss[0];
						
					}else{
						newFieldNames = fields[j];
					}
					if(fieldNames != null && newFieldNames.toLowerCase() == d.toLowerCase()){
						if(strArray != null && strArray.length == 2){
							sHtml = sHtml+tdS+strArray[0]+value+strArray[1]+tdE;
						}else{
							
							sHtml = sHtml+tdS+value+tdE;
						}
						bool = false;
					}else if(fieldNames == null){
						sHtml = sHtml+ "<td>"+value+"</td>";
					}
				}
			}

			
			if(null != lastColumnElement){
				var strArray2 = new Array(); 
				strArray2 = lastColumnElement.split("@");
				for(var z=0;z<strArray2.length;z++){
					var buttonr=strArray2[z];
					buttonr=buttonr.replace(/#/g,value);
					sHtml = sHtml+ "<td>"+buttonr+"</td>";
				}	
			}
			sHtml = sHtml + tdStr + "</tr>";
		}
		
		
	}
	return sHtml;
}


function creatTable7(fieldNames,page,firstColumnElement,lastColumnElement){
	var sHtml = "";
	if(page != null){
		if(page.data == null){
			return "";
		}
		var fields = new Array();
		var fieldsLength = 1;
		if(fieldNames != null){
			fields = fieldNames.split(",");
			fieldsLength = fields.length;
		}
		var dataLength = page.data.length;
		var dataList = page.data;
		var tdS = ""; var tdE = "";
		
		
		for(var i=0;i<dataLength;i++){
			sHtml = sHtml+ "<tr id = 'operateTr'>";
			var tdStr = "";
			if(null != firstColumnElement){
				var strArray2 = new Array(); 
				var value = dataList[i]['TRADPRODCODE'];
				strArray2 = firstColumnElement.split("@");
				for(var z=0;z<strArray2.length;z++){
					var buttonr=strArray2[z];
					buttonr=buttonr.replace(/#/g,value);
					sHtml = sHtml+ "<td>"+buttonr+"</td>";
				}
			}
			for(var j=0;j<fieldsLength;j++){
				for(var d in dataList[i]){
					var value = dataList[i][d];
					if(null==value){value="";}
					var bool = true;
					tdS = "<td>"; 
					tdE = "</td>";
					var strArray = new Array(); 
					var newFieldNames = "";
					if(fields[j].indexOf("</a>") > 0){
						newFieldNames = fields[j].substring(fields[j].indexOf('>')+1,fields[j].lastIndexOf('<'));
						strArray = fields[j].split(newFieldNames);
					}else if(fields[j].indexOf("@TDH") > 0){
						tdS = "<td style='display:none;'>";
						newFieldNames = fields[j].substring(0,fields[j].indexOf("@TDH"));
					}else if(fields[j].indexOf("?") > 0){
						var fieldss=fields[j].split("?");
						var jsonStr=fieldss[1];
						jsonStr=jsonStr.replace(/;/g,",");
						var jsonV= eval('('+jsonStr+')');
						for(var e=0;e<jsonV.length;e++){
							for(var key in jsonV[e]){
								var jvalue = jsonV[e][key];
								if(value==key){
									value=jvalue;
								}
							}
						}
						newFieldNames=fieldss[0];
						
					}else{
						newFieldNames = fields[j];
					}
					if(fieldNames != null && newFieldNames.toLowerCase() == d.toLowerCase()){
						if(strArray != null && strArray.length == 2){
							sHtml = sHtml+tdS+strArray[0]+value+strArray[1]+tdE;
						}else{
							
							sHtml = sHtml+tdS+value+tdE;
						}
						bool = false;
					}else if(fieldNames == null){
						sHtml = sHtml+ "<td>"+value+"</td>";
					}
				}
			}

			
			if(null != lastColumnElement){
				var strArray2 = new Array(); 
				
				
				strArray2 = lastColumnElement.split("@");
				for(var z=0;z<strArray2.length;z++){
					var buttonr=strArray2[z];
					var flow=true;
					
					while(flow){
						var start=buttonr.indexOf("{");
						var end =buttonr.indexOf("}");
						var lastval=buttonr.substring(start+1,end);
						var value = dataList[i][lastval];
						if(start>0){
							if(null==value){
								buttonr=buttonr.replace("{"+lastval+"}","");
							}else{
								buttonr=buttonr.replace("{"+lastval+"}",value);
							}
						}else{
							flow=false;
						}
					}
					sHtml = sHtml+ "<td>"+buttonr+"</td>";
				}	
			}
			sHtml = sHtml + tdStr + "</tr>";
		}
		
		
	}
	return sHtml;
}



function table_row_add(tableId,row_num,textName) {
	var ChannelCode=document.getElementById("org_no1_add").value;
	var ChannelName=document.getElementById("org_no2_add").value;
	var appSel = $("#selApp");
	var appid=appSel.val();
	var appName = appSel.find("option:selected").text()
	/**if(ChannelCode=="")
	{
		alert("请输入渠道代码！");
		return;
	}if(ChannelName=="")
	{
		alert("请输入渠道名称！");
		return;
	}
	if(appid == ""){
		alert("请选择网关接口！");
		return;
	}
	 */
	var rowNum = parseInt(document.getElementById(row_num).value); 
	var netRowNum = rowNum+1;  
	var tmp_HTML ="";//行HTML
		 tmp_HTML = 
			"<tr name='addTr'>"
			+"<td><input style='width:120px;border:none;text-align:center;background-color:#f6f7f9'  readonly='readonly' type='text' id='org_no1_"+netRowNum+"'  name='"+textName+"' value='"+ChannelCode+"'/></td>"
			+"<td><input style='width:120px;border:none;text-align:center;background-color:#f6f7f9'  readonly='readonly' type='text' id='org_no2_"+netRowNum+"'  name='"+textName+"' value='"+ChannelName+"'/></td>"
			if(appName !=""  && appid)
			{
				tmp_HTML+="<td><input style='width:120px;border:none;text-align:center;background-color:#f6f7f9'  readonly='readonly' type='text' id='appNameText"+netRowNum+"'  name='appNameText' value='"+appName+"'/>" +
					"<input type='hidden' id='org_no3_"+netRowNum+"' name='"+textName+"' value='"+appid+"'/></td>"
			}
			tmp_HTML+="<td><a  href=''  onclick=\"table_row_del('"+tableId+"',this);return false;\">删除</a></td>"+"</tr>";
			
	
	var lastTwoRow = parseInt($("#"+tableId+" tr").size())-2;
	$(tmp_HTML).insertBefore($("#"+tableId+" tr:eq("+lastTwoRow+")"));
	document.getElementById(row_num).value= rowNum+1;
	document.getElementById("org_no1_add").value="";
	document.getElementById("org_no2_add").value="";
	
	var height2 = $("#saveAppTable")[0].offsetHeight;
	var height = $("#"+tableId)[0].offsetHeight;
	var iframeHei = height2;
	if(height2 < height){
		iframeHei = height;
	}
	var main = $(window.parent.document).find("#iframe1");
	main.height(iframeHei+110);
	
}

/*三明治添加内容*/
function creatTable6(fieldNames,page,firstColumnElement,lastColumnElement){
	var sHtml = "";
	if(page != null){
		if(page.data == null){
			return "";
		}
		var fields = new Array();
		var fieldsLength = 1;
		if(fieldNames != null){
			fields = fieldNames.split(",");
			fieldsLength = fields.length;
		}
		var dataLength = page.data.length;
		var dataList = page.data;
		var tdS = ""; var tdE = "";
		
		
		for(var i=0;i<dataLength;i++){
			sHtml = sHtml+ "<tr>";
			var tdStr = "";
			if(null != firstColumnElement){
				var strArray2 = new Array(); 
				var value = dataList[i]['TRADPRODCODE'];
				strArray2 = firstColumnElement.split("@");
				for(var z=0;z<strArray2.length;z++){
					var buttonr=strArray2[z];
					buttonr=buttonr.replace(/#/g,value);
					sHtml = sHtml+ "<td>"+buttonr+"</td>";
				}
			}
			for(var j=0;j<fieldsLength;j++){
				for(var d in dataList[i]){
					var value = dataList[i][d];
					if(null==value){value="";}
					var bool = true;
					tdS = "<td>"; 
					tdE = "</td>";
					var strArray = new Array(); 
					var newFieldNames = "";
					if(fields[j].indexOf("</a>") > 0){
						newFieldNames = fields[j].substring(fields[j].indexOf('>')+1,fields[j].lastIndexOf('<'));
						strArray = fields[j].split(newFieldNames);
					}else if(fields[j].indexOf("@TDH") > 0){
						tdS = "<td style='display:none;'>";
						newFieldNames = fields[j].substring(0,fields[j].indexOf("@TDH"));
					}else if(fields[j].indexOf("?") > 0){
						var fieldss=fields[j].split("?");
						var jsonStr=fieldss[1];
						jsonStr=jsonStr.replace(/;/g,",");
						var jsonV= eval('('+jsonStr+')');
						for(var e=0;e<jsonV.length;e++){
							for(var key in jsonV[e]){
								var jvalue = jsonV[e][key];
								if(value==key){
									value=jvalue;
								}
							}
						}
						newFieldNames=fieldss[0];
						
					}else{
						newFieldNames = fields[j];
					}
					if(fieldNames != null && newFieldNames.toLowerCase() == d.toLowerCase()){
						if(strArray != null && strArray.length == 2){
							sHtml = sHtml+tdS+strArray[0]+value+strArray[1]+tdE;
						}else{
							
							sHtml = sHtml+tdS+value+tdE;
						}
						bool = false;
					}else if(fieldNames == null){
						sHtml = sHtml+ "<td>"+value+"</td>";
					}
				}
			}

			
			if(null != lastColumnElement){
				var strArray2 = new Array(); 
				
				
				strArray2 = lastColumnElement.split("@");
				for(var z=0;z<strArray2.length;z++){
					var buttonr=strArray2[z];
					var flow=true;
					
					while(flow){
						var start=buttonr.indexOf("{");
						var end =buttonr.indexOf("}");
						var lastval=buttonr.substring(start+1,end);
						var value = dataList[i][lastval];
						if(start>0){
							if(null==value){
								buttonr=buttonr.replace("{"+lastval+"}","");
							}else{
								buttonr=buttonr.replace("{"+lastval+"}",value);
							}
						}else{
							flow=false;
						}
					}
					sHtml = sHtml+ "<td>"+buttonr+"</td>";
				}	
			}
			sHtml = sHtml + tdStr + "</tr>";
		}
		
		
	}
	return sHtml;
}
/**
 * 为指定表格删除行
 * table_id:表格id
 * row_num:需要删除的行号
 */
function table_row_del(tableId,obj) {
	if(confirm('您确定要删除该行数据吗？')) {		
		$(obj).parent("td").parent("tr").remove();
	}
}

/**
 * 为指定表格 清空所有行
 * table_id:表格id
 * table_max_row_num:当前最大行号是多少
 */
function table_row_clear(tableId,rowNum) {
	//var tmp = $("#"+tableId+" tr").size();//获取表格一共有多少行
	//var tmp = $("#"+tableId).find("tr[name='addTr']").size();//获取表格一共有多少行
	if(confirm('您确定要删除所有行吗？')) {
		//for(var i=1;i<tmp;i++) {
			//$("#"+tableId+" tr:eq(1)").remove();
			$("#"+tableId).find("tr[name='addTr']").remove();
		//}
		document.getElementById(rowNum).value = 0;
		$("#org_no1_add").val("");
		$("#org_no2_add").val("");
	}
}

function resetAddText(tableId,rowNum){
	$("#"+tableId).find("tr[name='addTr']").remove();
	$("#org_no1_add").val("");$("#org_no2_add").val("");
	document.getElementById(rowNum).value = 0;
}

function indexNavigation(roleStr){
	var transMonitoringHref="ccic/transMonitoring/transMonitoringMain.jsp";//交易分析页面
	var logDownHref="ccic/transMonitoring/logDownload.jsp";//日志下载页面
	var appInfoConfigHref="ccic/channelManage/AppInfoConfig.jsp";//接口管理页面
	var channelConfigHref="ccic/channelManage/channelInfoConfig.jsp";//渠道管理页面
	var gatewayTransHref="ccic/channelManage/GatewayTrans.jsp";//数据维护页面面
	var channelMonitorHref="ccic/transMonitoring/monitorManager.jsp";//接口监控
	var testXmlHref = "ccic/channelManage/TestXML.jsp";
	var navigationStr="<ul>";
	var tempUrl = "";
	var tempClass="nav_li";
	if((roleStr&1)==1){
		tempUrl =transMonitoringHref;
		navigationStr+="<a href='"+transMonitoringHref+"'  target='indexIframe' ><li id='monitorLi' class='nav_li_d' onClick='navCss(this)'>交易分析</li></a>"+
				"<a href='"+logDownHref+"' target='indexIframe' ><li id='logLi' class='nav_li' onClick='navCss(this)'>日志下载</li></a>";
	}
	if((roleStr&2)==2){
		if(tempUrl==""){
			tempUrl =gatewayTransHref;
			tempClass="nav_li_d";
		}
		navigationStr+="<a href='"+gatewayTransHref+"' target='indexIframe' ><li id='gatewayTransLi' class='"+tempClass+"' onClick='navCss(this)'>数据维护</li></a>";
		tempClass="nav_li";
	}
	if((roleStr&4)==4){
		if(tempUrl==""){
			tempUrl =channelConfigHref;
			tempClass="nav_li_d";
		}
		navigationStr+="<a href='"+channelConfigHref+"' target='indexIframe' ><li id='channelConfigLi' class='"+tempClass+"' onClick='navCss(this)'>渠道管理</li></a>";
		tempClass="nav_li";
	}
	if((roleStr&8)==8){
		if(tempUrl==""){
			tempUrl =appInfoConfigHref;
			tempClass="nav_li_d";
		}
		navigationStr+="<a href='"+appInfoConfigHref+"' target='indexIframe' ><li id='appInfoConfigLi' class='"+tempClass+"' onClick='navCss(this)'>接口管理</li></a>";
		navigationStr+="<a href='"+channelMonitorHref+"' target='indexIframe' ><li id='channelConfigLi' class='nav_li' onClick='navCss(this)'>接口监控</li></a>";
		//navigationStr+="<a href='"+testXmlHref+"' target='indexIframe' ><li id='testXMLLi' class='nav_li' onClick='navCss(this)'>报文测试</li></a>";
		tempClass="nav_li";
	}
	navigationStr+="</ul>";
	$("div[id='navigationDiv']").append(navigationStr);
	$("iframe[id='iframe1']").attr("src",tempUrl);
	
}	

function navCss(e){
	
	$('.nav_li').css({'width':'80px', 'height':'29px', 'float':'left', 'padding-right':'3px', 'color':'#FFF', 'background':'url(../CCIC_Gateway/images/nav_1.jpg)  no-repeat'});
	$('.nav_li_d').css({'width':'80px', 'height':'29px', 'float':'left', 'padding-right':'3px', 'color':'#FFF', 'background':'url(../CCIC_Gateway/images/nav_1.jpg)  no-repeat'});
	$(e).css({'width':'80px','height':'29px', 'float':'left', 'padding-right':'3px', 'color':'#000', 'background':'url(../CCIC_Gateway/images/nav_2.jpg)  no-repeat'});
	
}

/**
 * @param d 当前点击页码
 * @param s 每次显示的页码个数
 * @param t 总数页数
 */
function creatChannelPage(d,s,t,m){
	if(d && s && t){
		var previous=d;//上一个
		var nexts =d; //下一个
		if(d>=t){nexts=t-1;}
		if(d==0){previous=2;}
		var x=Math.round(s/2);//中间位置
		var y=s%2;
		var start = d;
		if(d > x && d > s){
			if(y>0){
				start=d-x;
			}else{
				start=d-(x-1);
			}
			var z=(t-start)+1; //页面当前显示页码的个数
			if(z < s){//当页面显示页码个是少于规定页码显示数量是 实现补全
				start=start-(s-z); //重设开始页码
			}
		}else{
			start = 1;
		}
		var str = "选择";
		
		var strUl="<ul><li><a onClick=invokeM(1,"+m+");return false><img src='./images/page_1.jpg' /></a></li><li><a onClick=invokeM("+(previous-1)+","+m+");return false><img src='./images/page_2.jpg' /></a></li>";
		var strSelect ="<li>共"+t+"页&nbsp;到第&nbsp;<input type='text' id='switchPage' style='line-height:160%;height:22px;width:45px;text-align:center;border:1px solid #cdcbd0;font-size:8pt;' value="+d+" >&nbsp;页 <img src='./images/page_7.jpg' onclick='loadDateBySelVal(this,"+m+","+t+")'/>";
//				"<a href='javascript:void(0)' style='background-color:white;border:1px solid #cdcbd0;width:30px;height:22px;line-height:22px; ' onclick='loadDateBySelVal(this,"+m+","+t+")'>Go</a></li>";
		if(start > 0){
			var j =1;
			for(var i=start;i<=t;i++){
				//strSelect+="<option value='"+i+"'>"+i+"</option>";
				var str = i+"";
				if(i!=d){
					if(j<=s){
//							strUl+='<li class="page_a"><a href="" onClick="invokeM('+i+','+m+');return false">'+i+'</a></li>';
						if(str.length==1 || str.length==2){
							strUl+='<li class="page_a"><a href="" style="border:0px solid #cdcbd0;" onClick="invokeM('+i+','+m+');return false">'+i+'</a></li>';
						}
						if(str.length>=3){
							strUl+='<li class="page_a"><a href="" style="border:0px solid #cdcbd0;width:'+str.length+'5px;"  onClick="invokeM('+i+','+m+');return false">'+i+'</a></li>';
						}
					}
				}else{
//					strUl+='<li class="page_a"><a href="" class="page_a_click" onClick="invokeM('+i+','+m+');return false">'+i+'</a></li>';
					if(str.length==1 || str.length==2){
						strUl+='<li  class="page_a"><a href="" class="page_a_click" onClick="invokeM('+i+','+m+');return false">'+i+'</a></li>';					}
					if(str.length>=3){
						strUl+='<li  class="page_a"><a href="" style="width:'+str.length+'5px;" class="page_a_click" onClick="invokeM('+i+','+m+');return false">'+i+'</a></li>';
					}
				}
				j++;
			}
			
			
			
		}
		strUl+="<li><a onClick=invokeM("+(nexts-1+2)+","+m+");return false><img src='./images/page_3.jpg'/></a></li><li><a onClick=invokeM("+t+","+m+");return false><img src='./images/page_4.jpg' /></a></li>";
		var resultStr = strUl+strSelect+"</ul>";
		return resultStr;
	}
	return "";
}



/**
 * @param d 当前点击页码
 * @param s 每次显示的页码个数
 * @param t 总数页数
 */
function creatChannelPage2(d,s,t,m){
	if(d && s && t){
		var previous=d;//上一个
		var nexts =d; //下一个
		if(d>=t){nexts=t-1;}
		if(d==0){previous=2;}
		var x=Math.round(s/2);//中间位置
		var y=s%2;
		var start = d;
		if(d > x && d > s){
			if(y>0){
				start=d-x;
			}else{
				start=d-(x-1);
			}
			var z=(t-start)+1; //页面当前显示页码的个数
			if(z < s){//当页面显示页码个是少于规定页码显示数量是 实现补全
				start=start-(s-z); //重设开始页码
			}
		}else{
			start = 1;
		}
		var str = "选择";
		
		var strUl="<ul><li><a onClick=invokeM(1,"+m+");return false><img src='./images/page_1.jpg' /></a></li><li><a onClick=invokeM("+(previous-1)+","+m+");return false><img src='./images/page_2.jpg' /></a></li>";
		var strSelect ="<li>共"+t+"页&nbsp;到第&nbsp;<input type='text' id='switchPage2' style='line-height:160%;height:22px;width:45px;text-align:center;border:1px solid #cdcbd0;font-size:8pt;' value="+d+" >&nbsp;页 <img src='./images/page_7.jpg' onclick='loadDateBySelVal2(this,"+m+","+t+")'/>";
		if(start > 0){
			var j =1;
			for(var i=start;i<=t;i++){
				var str = i+"";
				if(i!=d){
					if(j<=s){
						if(str.length==1 || str.length==2){
							strUl+='<li class="page_a"><a href="" style="border:0px solid #cdcbd0;" onClick="invokeM('+i+','+m+');return false">'+i+'</a></li>';
						}
						if(str.length>=3){
							strUl+='<li class="page_a"><a href="" style="border:0px solid #cdcbd0;width:'+str.length+'5px;"  onClick="invokeM('+i+','+m+');return false">'+i+'</a></li>';
						}
					}
				}else{
					if(str.length==1 || str.length==2){
						strUl+='<li  class="page_a"><a href="" class="page_a_click" onClick="invokeM('+i+','+m+');return false">'+i+'</a></li>';					}
					if(str.length>=3){
						strUl+='<li  class="page_a"><a href="" style="width:'+str.length+'5px;" class="page_a_click" onClick="invokeM('+i+','+m+');return false">'+i+'</a></li>';
					}
				}
				j++;
			}
		}
		strUl+="<li><a onClick=invokeM("+(nexts-1+2)+","+m+");return false><img src='./images/page_3.jpg'/></a></li><li><a onClick=invokeM("+t+","+m+");return false><img src='./images/page_4.jpg' /></a></li>";
		var resultStr = strUl+strSelect+"</ul>";
		return resultStr;
	}
	return "";
}

/**
 * @param d 当前点击页码
 * @param s 每次显示的页码个数
 * @param t 总数页数
 */
function creatChannelPage3(d,s,t,m){
	if(d && s && t){
		var previous=d;//上一个
		var nexts =d; //下一个
		if(d>=t){nexts=t-1;}
		if(d==0){previous=2;}
		var x=Math.round(s/2);//中间位置
		var y=s%2;
		var start = d;
		if(d > x && d > s){
			if(y>0){
				start=d-x;
			}else{
				start=d-(x-1);
			}
			var z=(t-start)+1; //页面当前显示页码的个数
			if(z < s){//当页面显示页码个是少于规定页码显示数量是 实现补全
				start=start-(s-z); //重设开始页码
			}
		}else{
			start = 1;
		}
		var str = "选择";
		
		var strUl="<ul><li><a onClick=invokeM(1,"+m+");return false><img src='./images/page_1.jpg' /></a></li><li><a onClick=invokeM("+(previous-1)+","+m+");return false><img src='./images/page_2.jpg' /></a></li>";
		var strSelect ="<li>共"+t+"页&nbsp;到第&nbsp;<input type='text' id='switchPage3' style='line-height:160%;height:22px;width:45px;text-align:center;border:1px solid #cdcbd0;font-size:8pt;' value="+d+" >&nbsp;页 <img src='./images/page_7.jpg' onclick='loadDateBySelVal3(this,"+m+","+t+")'/>";
		if(start > 0){
			var j =1;
			for(var i=start;i<=t;i++){
				var str = i+"";
				if(i!=d){
					if(j<=s){
						if(str.length==1 || str.length==2){
							strUl+='<li class="page_a"><a href="" style="border:0px solid #cdcbd0;" onClick="invokeM('+i+','+m+');return false">'+i+'</a></li>';
						}
						if(str.length>=3){
							strUl+='<li class="page_a"><a href="" style="border:0px solid #cdcbd0;width:'+str.length+'5px;"  onClick="invokeM('+i+','+m+');return false">'+i+'</a></li>';
						}
					}
				}else{
					if(str.length==1 || str.length==2){
						strUl+='<li  class="page_a"><a href="" class="page_a_click" onClick="invokeM('+i+','+m+');return false">'+i+'</a></li>';					}
					if(str.length>=3){
						strUl+='<li  class="page_a"><a href="" style="width:'+str.length+'5px;" class="page_a_click" onClick="invokeM('+i+','+m+');return false">'+i+'</a></li>';
					}
				}
				j++;
			}
		}
		strUl+="<li><a onClick=invokeM("+(nexts-1+2)+","+m+");return false><img src='./images/page_3.jpg'/></a></li><li><a onClick=invokeM("+t+","+m+");return false><img src='./images/page_4.jpg' /></a></li>";
		var resultStr = strUl+strSelect+"</ul>";
		return resultStr;
	}
	return "";
}
/**
 * @param d 当前点击页码
 * @param s 每次显示的页码个数
 * @param t 总数页数
 */
function creatChannelPage4(d,s,t,m){
	if(d && s && t){
		var previous=d;//上一个
		var nexts =d; //下一个
		if(d>=t){nexts=t-1;}
		if(d==0){previous=2;}
		var x=Math.round(s/2);//中间位置
		var y=s%2;
		var start = d;
		if(d > x && d > s){
			if(y>0){
				start=d-x;
			}else{
				start=d-(x-1);
			}
			var z=(t-start)+1; //页面当前显示页码的个数
			if(z < s){//当页面显示页码个是少于规定页码显示数量是 实现补全
				start=start-(s-z); //重设开始页码
			}
		}else{
			start = 1;
		}
		var str = "选择";
		
		var strUl="<ul><li><a onClick=invokeM(1,"+m+");return false><img src='./images/page_1.jpg' /></a></li><li><a onClick=invokeM("+(previous-1)+","+m+");return false><img src='./images/page_2.jpg' /></a></li>";
		var strSelect ="<li>共"+t+"页&nbsp;到第&nbsp;<input type='text' id='switchPage4' style='line-height:160%;height:22px;width:45px;text-align:center;border:1px solid #cdcbd0;font-size:8pt;' value="+d+" >&nbsp;页 <img src='./images/page_7.jpg' onclick='loadDateBySelVal4(this,"+m+","+t+")'/>";
		if(start > 0){
			var j =1;
			for(var i=start;i<=t;i++){
				var str = i+"";
				if(i!=d){
					if(j<=s){
						if(str.length==1 || str.length==2){
							strUl+='<li class="page_a"><a href="" style="border:0px solid #cdcbd0;" onClick="invokeM('+i+','+m+');return false">'+i+'</a></li>';
						}
						if(str.length>=3){
							strUl+='<li class="page_a"><a href="" style="border:0px solid #cdcbd0;width:'+str.length+'5px;"  onClick="invokeM('+i+','+m+');return false">'+i+'</a></li>';
						}
					}
				}else{
					if(str.length==1 || str.length==2){
						strUl+='<li  class="page_a"><a href="" class="page_a_click" onClick="invokeM('+i+','+m+');return false">'+i+'</a></li>';					}
					if(str.length>=3){
						strUl+='<li  class="page_a"><a href="" style="width:'+str.length+'5px;" class="page_a_click" onClick="invokeM('+i+','+m+');return false">'+i+'</a></li>';
					}
				}
				j++;
			}
		}
		strUl+="<li><a onClick=invokeM("+(nexts-1+2)+","+m+");return false><img src='./images/page_3.jpg'/></a></li><li><a onClick=invokeM("+t+","+m+");return false><img src='./images/page_4.jpg' /></a></li>";
		var resultStr = strUl+strSelect+"</ul>";
		return resultStr;
	}
	return "";
}

/**
 * @param d 当前点击页码
 * @param s 每次显示的页码个数
 * @param t 总数页数
 */
function creatChannelPageN(d,s,t,m){
	if(d && s && t){
		var previous=d;//上一个
		var nexts =d; //下一个
		if(d>=t){nexts=t-1;}
		if(d==0){previous=2;}
		var x=Math.round(s/2);//中间位置
		var y=s%2;
		var start = d;
		if(d > x && d > s){
			if(y>0){
				start=d-x;
			}else{
				start=d-(x-1);
			}
			var z=(t-start)+1; //页面当前显示页码的个数
			if(z < s){//当页面显示页码个是少于规定页码显示数量是 实现补全
				start=start-(s-z); //重设开始页码
			}
		}else{
			start = 1;
		}
		var str = "选择";
		
		var strUl="<ul><li><a onClick=invokeM(1,"+m+");return false><img src='./images/page_1.jpg' /></a></li><li><a onClick=invokeM("+(previous-1)+","+m+");return false><img src='./images/page_2.jpg' /></a></li>";
		var strSelect ="<li>跳转到:<select id='selectPage' class='page_select_1' onchange='loadDateBySelVal(this,"+m+")'><option value='1' selected='selected'>"+str+"</option>";
		if(start > 0){
			var j =1;
			for(var i=start;i<=t;i++){
				//strSelect+="<option value='"+i+"'>"+i+"</option>";
				if(i!=d){
					if(j<=s){
						strUl+='<li class="page_a"><a href="" onClick="invokeM('+i+','+m+');return false">'+i+'</a></li>';
					}
				}else{
					strUl+='<li class="page_a"><a href="" class="page_a_click" onClick="invokeM('+i+','+m+');return false">'+i+'</a></li>';
				}
				j++;
			}
			for(var s=1;s<=t;s++){
				if(s==d){
					strSelect+="<option value='"+s+"' selected>"+s+"</option>";
				}else{
					strSelect+="<option value='"+s+"'>"+s+"</option>";
				}
			}
		}
		strSelect+="</select></li>";
		strUl+="<li><a onClick=invokeM("+(nexts-1+2)+","+m+");return false><img src='./images/page_3.jpg'/></a></li><li><a onClick=invokeM("+t+","+m+");return false><img src='./images/page_4.jpg' /></a></li>";
		var resultStr = strUl+strSelect+"</ul>";
		return resultStr;
	}
	return "";
}
function loadDateBySelVal(t,m,total){
	 //var selVal = $(t).find("option:selected").val();
	var selVal = $('#switchPage').val();
	if(selVal==""){
		selVal=1;
	}
	var reg = /^([1-9]\d*|0)$/;
	 //if(selVal){
		 if(reg.test(selVal)){
			 if(selVal>total){
				 selVal = total;
			 }
			 if(selVal<=0){
				 selVal = 1;
			 }
		 }else{
			 selVal = 1;
		 }
		 invokeM(selVal,m);
	 }

function loadDateBySelVal2(t,m,total){
	 //var selVal = $(t).find("option:selected").val();
	var selVal = $('#switchPage2').val();
	if(selVal==""){
		selVal=1;
	}
	var reg = /^([1-9]\d*|0)$/;
	 //if(selVal){
		 if(reg.test(selVal)){
			 if(selVal>total){
				 selVal = total;
			 }
			 if(selVal<=0){
				 selVal = 1;
			 }
		 }else{
			 selVal = 1;
		 }
		 invokeM(selVal,m);
	 }

function loadDateBySelVal3(t,m,total){
	var selVal = $('#switchPage3').val();
	if(selVal==""){
		selVal=1;
	}
	var reg = /^([1-9]\d*|0)$/;
		 if(reg.test(selVal)){
			 if(selVal>total){
				 selVal = total;
			 }
			 if(selVal<=0){
				 selVal = 1;
			 }
		 }else{
			 selVal = 1;
		 }
		 invokeM(selVal,m);
	 }
function loadDateBySelVal4(t,m,total){
	var selVal = $('#switchPage4').val();
	if(selVal==""){
		selVal=1;
	}
	var reg = /^([1-9]\d*|0)$/;
		 if(reg.test(selVal)){
			 if(selVal>total){
				 selVal = total;
			 }
			 if(selVal<=0){
				 selVal = 1;
			 }
		 }else{
			 selVal = 1;
		 }
		 invokeM(selVal,m);
	 }

function invokeM(p1,p2){
	if(p1 && p2){
		switch(p2){
		case 1:
			queryChannelInfo(p1);
			break;
		case 2:
			queryChannelMapping(p1);
			//method({str:"loadChannelMapping",displayPages:p1});
			break;
		case 3:
			queryTrans(p1);
			break;
		case 4:
			queryTXLogData(p1);
			break;
		case 5:
			queryApp(p1);
			break;
		case 6:
			queryUser(p1);
			break;
		case 7:
			queryProduct(p1);
			break;
		case 8:
			queryRole(p1);
			break;
		case 9:
			queryMenu(p1);
			break;
		case 10:
			queryCreditLmtDef(p1);
			break;
		case 11:
			queryProductTemplet(p1);
			break;
		case 12:
			queryProductPlan(p1);
			break;
		case 13:
			queryProdPlan(p1);
			break;
		case 14:
			queryCovpage(p1);
			break;
		case 15:
			queryInsuPlan(p1);
			break;
		case 16:
			queryTradPartners(p1);
			break;
		case 17:
			queryTradProdInst(p1);
			break;
		case 18:
			queryCoreDept(p1);
			break;
		case 19:
			queryChannelInfo(p1);
			break;
		case 20:
			querySubChannel(p1);
			break;
		case 21:
			queryFacadeUser(p1);
			break;
		case 22:
			queryInsureGroup(p1);
			break;
		case 23:
			queryInsuPlan(p1);
			break;
		case 24:
			queryAgencyInfo(p1);
			break;
		case 25:
			queryPrivilegeDeptInfo(p1);
			break;
		case 26:
			queryAppendDetail(p1);
			break;
		case 27:
			queryLifePolicy(p1);
			break;
		case 28:
			queryAgentMtInfo(p1);
			break;
		case 29:
			querySubChannelInfo(p1);
			break;
		case 30:
			queryConfProxyInfo3(p1);
			break;
		case 31:
			queryConfProxyInfoEdit3(p1);
			break;
		case 32:
			queryConfProxyInfo4(p1);
			break;
		case 33:
			queryConfProxyInfoEdit4(p1);
			break;
		case 34:
			queryConfProxyInfoEdit4(p1);
			break;
		case 35:
			queryNocarConfProxyInfoEdit3(p1);
			break;
		case 36:
			queryNocarConfProxyInfo4(p1);
			break;
		case 37:
			queryNocarConfProxyInfoEdit4(p1);
			break;
		case 38:
			queryChannel(p1);
			break;
		case 39:
			querysubChannelInfo(p1);
			break;
		case 40:
			queryUserRole(p1);
			break;
		case 41:
			queryTradNoticeMtInfo(p1);
			break;
		case 42:
			queryChannelInfo(p1);
			break;
		case 43:
			queryNlifeProd(p1);
			break;
		case 44:
			queryDept(p1);
			break;
		case 45:
			queryAgentInfoRela3(p1);
			break;
		case 46:
			queryAgentInfoRela4(p1);
			break;
		case 47:
			queryAgentInfo3(p1);
			break;
		case 48:
			queryAgentInfo4(p1);
			break;
		case 49:
			queryNlifePlan(p1);
			break;
		case 50:
			queryNewLifeProduct(p1);
			break;
		case 51:
			queryNewLifeProductTemplet(p1);
			break;
		case 52:
			queryNewLifeProdRisk(p1);
			break;
		case 53:
			queryNewLifeTradProdRiskInfo(p1);
			break;
		case 54:
			queryNocarPolicy(p1);
			break;
		case 55:
			queryOrder(p1);
			break;
		case 56:
			queryPolicy(p1);
			break;
		case 57:
			queryStandBook(p1);
			break;
		case 58:
			queryVat(p1);
			break;
		case 59:
			queryAuwConfigs(p1);
			break;
		case 60:
			queryAgentInfoRela5(p1);
			break;
		case 61:
			queryAgentInfo5(p1);
			break;
		case 62:
			querySale(p1);
			break;
		case 63:
			queryAgentInfo6(p1);
			break;
		case 64:
			queryAgentInfoRela6(p1);
			break;
		case 65:
			queryCoreDept1(p1);
			break;
		case 66:
			openChannelPageDiv(p1);
			break;
		case 67:
			queryGrouList(p1);
			break;
		case 68:
			queryGrouPlanList(p1);
			break;
		case 69:
			queryDept(p1);
			break;
		case 70:
			planFeeParam(p1);
			break;
		case 71:
			queryAgentInfoZon4(p1);
			break;
		case 72:
			queryCarTemplate(p1);
			break;
		case 73:
			queryApproval(p1);
			break;
		case 74:
			 getCardList(p1);
			break;
		case 75:
			queryCardInfo(p1);
			break;
		case 76:
			loadCardData(p1);
			break;
		case 77:
			loadCardDataForReturn(p1);
			break;
		case 78:
			queryuserList(p1);
			break;
		case 79:
			queryNocarConfProxyInfo3(p1);
		case 80:
			setDetailsData(p1);
			return;
		case 81:
			queryReportList(p1);
			return;
		case 82:
			queryCreditProduct(p1);
			break;
		case 83:
			queryCreditPlan(p1);
			break;
		case 84:
			queryCreditProd(p1);
			break;
		case 85:
			queryDictList(p1);
			break;
		case 86:
			showEinvoiceInfo(p1);
			break;
		case 87:
			setAmountParam(p1);
			break;
		case 90:
			queryAgentInfoZon5(p1); 
			break;
		case 91:
			queryPlan(p1); 
			break;
		case 92:
			queryRuleAgent(p1); 
			break;
		case 93:
			queryRuleInfo(p1); 
			break;
		case 94:
			queryDefinition(p1); 
			break;
		case 96:
			queryRiskContent(p1);
			break;
		case 97:
			queryInvioce(p1);
			break;
		case 98:
			queryEdrno(p1);
			break;
		case 99:
			openPlanDiv(p1); 
			break;
		case 100:
			querySchoolConfig(p1); 
			break;
		case 101:
			queryNlifeHealthInform(p1);
			break;
		case 102:
			queryUnionQRCodeListByPageNumber(p1);
			break;
		case 103:
			queryRecCheckList(p1);
			break;
        case 104:
            queryInfoByForm(p1);
            break;
        case 105:
        	queryUnionQRCodeList(p1);
            break;
        case 106:
        	queryChannelInfo(p1);
            break;
        case 107:
        	loadConfigedScanCode(p1);
        	break;
        case 108:
        	queryScanCode(p1);
        	break;
		case 109:
			queryConfigPlan(p1,false);
			break;
		case 110:
			queryMenuListByPageNumber(p1);
			break;
		case 111:
			queryApplicationPage(p1);
			break;
		case 112:
			queryPolicyPageByApplyId(p1);
			break;
		case 113:
			queryCtripPage(p1);
			break;
		case 114:
			queryPolicyPageByEffecttime(p1);
			break;
		}
	}
}
//对于只能录入数字带小数带你的控件增加 公共方法 ,便于维护; added by guozizhou@20150420 begin
function clearNoNum(event,obj){ 
    //响应鼠标事件，允许左右方向键移动 
    event = window.event||event; 
    if(event.keyCode == 37 | event.keyCode == 39){ 
        return; 
    } 
    //先把非数字的都替换掉，除了数字和. 
    obj.value = obj.value.replace(/[^\d.]/g,""); 
    //必须保证第一个为数字而不是. 
    obj.value = obj.value.replace(/^\./g,""); 
    //保证只有出现一个.而没有多个. 
    obj.value = obj.value.replace(/\.{2,}/g,"."); 
    //保证.只出现一次，而不能出现两次以上 
    obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$","."); 
} 
function checkNum(obj){ 
    //为了去除最后一个. 
    obj.value = obj.value.replace(/\.$/g,""); 
}
//对于只能录入数字带小数带你的控件增加 公共方法 ,便于维护; added by guozizhou@20150420 end

function creatTable3(fieldNames,page,firstColumnElement,lastColumnElement){
	var sHtml = "";
	if(page != null){
		if(page.data == null){
			return "";
		}
		var fields = new Array();
		var fieldsLength = 1;
		if(fieldNames != null){
			fields = fieldNames.split(",");
			fieldsLength = fields.length;
		}
		var dataLength = page.data.length;
		var dataList = page.data;
		var tdS = ""; var tdE = "";
		
		
		for(var i=0;i<dataLength;i++){
			sHtml = sHtml+ "<tr>";
			var tdStr = "";
			if(null != firstColumnElement){
				var strArray2 = new Array(); 
				var value = dataList[i]['TRADPRODCODE'];
				strArray2 = firstColumnElement.split("@");
				for(var z=0;z<strArray2.length;z++){
					var buttonr=strArray2[z];
					buttonr=buttonr.replace(/#/g,value);
					sHtml = sHtml+ "<td>"+buttonr+"</td>";
				}
			}
			for(var j=0;j<fieldsLength;j++){
				for(var d in dataList[i]){
					var value = dataList[i][d];
					if(null==value){value="";}
					var bool = true;
					tdS = "<td>"; 
					tdE = "</td>";
					var strArray = new Array(); 
					var newFieldNames = "";
					if(fields[j].indexOf("</a>") > 0){
						newFieldNames = fields[j].substring(fields[j].indexOf('>')+1,fields[j].lastIndexOf('<'));
						strArray = fields[j].split(newFieldNames);
					}else if(fields[j].indexOf("@TDH") > 0){
						tdS = "<td style='display:none;'>";
						newFieldNames = fields[j].substring(0,fields[j].indexOf("@TDH"));
					}else if(fields[j].indexOf("?") > 0){
						var fieldss=fields[j].split("?");
						var jsonStr=fieldss[1];
						jsonStr=jsonStr.replace(/;/g,",");
						var jsonV= eval('('+jsonStr+')');
						for(var e=0;e<jsonV.length;e++){
							for(var key in jsonV[e]){
								var jvalue = jsonV[e][key];
								if(value==key){
									value=jvalue;
								}
							}
						}
						newFieldNames=fieldss[0];
						
					}else{
						newFieldNames = fields[j];
					}
					if(fieldNames != null && newFieldNames.toLowerCase() == d.toLowerCase()){
						if(strArray != null && strArray.length == 2){
							sHtml = sHtml+tdS+strArray[0]+value+strArray[1]+tdE;
						}else{
							
							sHtml = sHtml+tdS+value+tdE;
						}
						bool = false;
					}else if(fieldNames == null){
						sHtml = sHtml+ "<td>"+value+"</td>";
					}
				}
			}

			
			if(null != lastColumnElement){
				var strArray2 = new Array(); 
				strArray2 = lastColumnElement.split("@");
				for(var z=0;z<strArray2.length;z++){
					value = dataList[i]['EPOLICY_URL'];
					var buttonr=strArray2[z];
					buttonr=buttonr.replace(/#/g,value);
					sHtml = sHtml+ "<td>"+buttonr+"</td>";
				}	
			}
			sHtml = sHtml + tdStr + "</tr>";
		}
		
		
	}
	return sHtml;
}

function creatTable8(fieldNames, list) {
	var sHtml = "";
	if (list != null) {
		if (list.size == 0) {
			return "";
		}
		var fields = new Array();
		var fieldsLength = 1;
		if (fieldNames != null) {
			fields = fieldNames.split(",");
			fieldsLength = fields.length;
		}
		var dataLength = list.length;
		var dataList = list;
		var tdS = "";
		var tdE = "";
		for (var r = 0; r < list.length; r++) {
			var dataList = list[r].nlifeRisk;
			for (var i = 0; i < dataList.length; i++) {
				sHtml = sHtml + "<tr id = 'operateTr'>";
				var tdStr = "";
				for (var j = 0; j < fieldsLength; j++) {
					for ( var d in dataList[i]) {
						var value = dataList[i][d];
						if (null == value) {
							value = "";
						}
						var bool = true;
						tdS = "<td>";
						tdE = "</td>";
						var strArray = new Array();
						var newFieldNames = "";
						if (fields[j].indexOf("</a>") > 0) {
							newFieldNames = fields[j].substring(fields[j].indexOf('>') + 1, fields[j].lastIndexOf('<'));
							strArray = fields[j].split(newFieldNames);
						} else if (fields[j].indexOf("@TDH") > 0) {
							tdS = "<td style='display:none;'>";
							newFieldNames = fields[j].substring(0, fields[j].indexOf("@TDH"));
						} else if (fields[j].indexOf("?") > 0) {
							var fieldss = fields[j].split("?");
							var jsonStr = fieldss[1];
							jsonStr = jsonStr.replace(/;/g, ",");
							var jsonV = eval('(' + jsonStr + ')');
							for (var e = 0; e < jsonV.length; e++) {
								for ( var key in jsonV[e]) {
									var jvalue = jsonV[e][key];
									if (value == key) {
										value = jvalue;
									}
								}
							}
							newFieldNames = fieldss[0];
						} else {
							newFieldNames = fields[j];
						}
						if (fieldNames != null
								&& newFieldNames.toLowerCase() == d.toLowerCase()) {
							if (strArray != null && strArray.length == 2) {
								sHtml = sHtml + tdS + strArray[0] + value + strArray[1] + tdE;
							} else {
								sHtml = sHtml + tdS + value + tdE;
							}
							bool = false;
						} else if (fieldNames == null) {
							sHtml = sHtml + "<td>" + value + "</td>";
						}
					}
				}
				sHtml = sHtml + tdStr + "</tr>";
			}
		}
	}
	return sHtml;
}
//-----------------------------报表查询 不显示总页数 lfd added 20190515
/**
 * @param d 当前点击页码
 * @param s 每次显示的页码个数
 */
function creatSiggleChannelPage(d,m) {
    if(!d) {
        return ''
    }
    
    d = d-0
    var previous = d<=1?1:d-1
    var nexts = d+1
    var str = "";
    // 首页 上一页
    str +="<ul><li><a onClick=invokeM(1,"+m+");return false><img src='./images/page_1.jpg' /></a></li><li><a onClick=invokeM("+previous+","+m+");return false><img src='./images/page_2.jpg' /></a></li>";
    // 显示当前页数
    str +='<li  class="page_a"><a href="" class="page_a_click" onClick="invokeM('+d+','+m+');return false">'+d+'</a></li>';
    
    // 下一页
    str +="<li><a onClick=invokeM("+nexts+","+m+");return false><img src='./images/page_3.jpg'/></a></li>";

    // 到第几页
    str += "&nbsp;&nbsp;到第&nbsp;<input type='text' id='switchPage' style='line-height:160%;height:22px;width:45px;text-align:center;border:1px solid #cdcbd0;font-size:8pt;' value="+d+" >&nbsp;页 <img src='./images/page_7.jpg' onclick='loadDateBySinggleSelVal("+m+")'/>";
    return str;
}
function loadDateBySinggleSelVal(m) {
    var selVal = $('#switchPage').val();
    invokeM(selVal,m);
}
//lfd added 分页页码 新样式
/**
* @param d 当前点击页码
* @param s 每次显示的页码个数
* @param t 总数页数
* @param m 回调函数的参数
* @param a 每页条数
* @param b 总条数
*/
function creatNewChannelPage(d,s,t,m,a,b){
 if(d && s && t){
     var previous=d;//上一个
     var nexts =d; //下一个
     if(d>=t){nexts=t-1;}
     if(d==0){previous=2;}
     var x=Math.round(s/2);//中间位置
     var y=s%2;
     var start = d;
     if(d > x && d > s){
         if(y>0){
             start=d-x;
         }else{
             start=d-(x-1);
         }
         var z=(t-start)+1; //页面当前显示页码的个数
         if(z < s){//当页面显示页码个是少于规定页码显示数量是 实现补全
             start=start-(s-z); //重设开始页码
         }
     }else{
         start = 1;
     }
     var str = "选择";

     var strUl="<ul>"
     strUl += "<li>共 " + b + " 条 <select style='width: 93px; line-height: 25px; height: 25px; border: 1px solid #eee;padding: 0 10px;border: 1px solid #eee;margin: -4px 10px;' onChange='loadDataByRowCount("+m + ");return false'>"

     for (var z = 5; z <= 50; z=z+5) {
     	if (z===a) {
     		strUl += '<option class="page_checked"  selected="selected" value="'+z+'">' + z + ' 条/页 </option>'
     	} else {
             strUl += '<option value="'+z+'">' + z + ' 条/页 </option>'
     	}
     }

     strUl += "</select></li>"
     strUl += "<li><a onClick='newInvokeM(1,"+m+"," + a + ");return false'><img src='./images/p_first.png' /></a></li><li><a onClick=newInvokeM("+(previous-1)+","+m+"," + a + ");return false><img src='./images/p_up.png' /></a></li>";

     var strSelect ="<li>前往 <select id='selectPage' class='page_select_1' style='width: 60px; line-height: 30px; height: 30px; border: 1px solid #eee;padding: 0 10px;border: 1px solid #eee;margin: -3px 10px;' onchange='loadNewDateBySelVal(this,"+m+"," + a + ")'><option value='1' selected='selected'>"+str+"</option>";
     if(start > 0){
         var j =1;
         for(var i=start;i<=t;i++){
             //strSelect+="<option value='"+i+"'>"+i+"</option>";
             if(i!=d){
                 if(j<=s){
                     strUl+='<li class="page_a"><a href="" onClick="newInvokeM('+i+','+m+',' + a + ');return false">'+i+'</a></li>';
                 }
             }else{
                 strUl+='<li class="page_a"><a href="" class="page_a_click" onClick="newInvokeM('+i+','+m+',' + a + ');return false">'+i+'</a></li>';
             }
             j++;
         }
         for(var s=1;s<=t;s++){
             if(s==d){
                 strSelect+="<option value='"+s+"' selected>"+s+"</option>";
             }else{
                 strSelect+="<option value='"+s+"'>"+s+"</option>";
             }
         }
     }
     strSelect+="</select> 页 </li>";
     strUl+="<li><a onClick='newInvokeM("+(nexts-1+2)+","+m+"," + a + ");return false'><img src='./images/p_down.png'/></a></li><li><a onClick='newInvokeM("+t+","+m+"," + a + ");return false'><img src='./images/p_last.png' /></a></li>";
     var resultStr = strUl+strSelect+"</ul>";
     return resultStr;
 }
 return "";
}

/**
* 分页查询点击页码回调的方法 lfd changed 20191120
*
* @param p1 传入方法的参数（查询的页码）
* @param p2 调用哪个方法的标记
* @param p3 传入方法的参数（每次查询每页多少条）
*
*/
function newInvokeM(p1,p2,p3){
 if(p1 && p2){
     switch(p2){
     case 1:
     	setAmountParam(p1,p3);
         break;
     case 2:
     	setPartnerParam(p1,p3);
         break;

     }
 }
}
/**
* 根据点击更改查询的每页条数 lfd added 20191120
*
* @param m 调用哪个方法的标记
*/
function loadDataByRowCount (m) {
	var e = window.event
	var $this = $(e.target)
	// 获取的每页条数的值
	var a = parseInt($(e.target).val())

	var reg = /^(0|[1-9][0-9]*)$/
	if (reg.test(a)) {
		newInvokeM(1, m, a)
	} else {
		$.message("error", "请正确选择每页条数！")
	}
}
//新的分页样式 lfd 20191121 added
function loadNewDateBySelVal (t,m,a,total) {
	var selVal = $('#selectPage').val();
	if(selVal==""){
		selVal=1;
	}
	var reg = /^([1-9]\d*|0)$/;
	
	if(reg.test(selVal)){
		 if(selVal>total){
			 selVal = total;
		 }
		 if(selVal<=0){
			 selVal = 1;
		 }
	}else{
		selVal = 1;
	}
	newInvokeM(selVal,m);
}

function creatTable9(fieldNames, page, firstColumnElement, lastColumnElement) {
	var sHtml = "";
	if (page != null) {
		if (page.data == null) {
			return "";
		}
		var fields = new Array();
		var fieldsLength = 1;
		if (fieldNames != null) {
			fields = fieldNames.split(",");
			fieldsLength = fields.length;
		}
		var dataLength = page.data.length;
		var dataList = page.data;
		var tdS = "";
		var tdE = "";
		for (var i = 0; i < dataLength; i++) {
			sHtml = sHtml + "<tr>";
			var tdStr = "";
			if (null != firstColumnElement) {
				var strArray2 = new Array();
				var value = dataList[i]['TRADPRODCODE'];
				strArray2 = firstColumnElement.split("@");
				for (var z = 0; z < strArray2.length; z++) {
					var buttonr = strArray2[z];
					buttonr = buttonr.replace(/#/g, value);
					sHtml = sHtml + "<td>" + buttonr + "</td>";
				}
			}
			for (var j = 0; j < fieldsLength; j++) {
				for ( var d in dataList[i]) {
					var value = dataList[i][d];
					if (null == value) {
						value = "";
					}
					var bool = true;
					tdS = "<td>";
					tdE = "</td>";
					var strArray = new Array();
					var newFieldNames = "";
					if (fields[j].indexOf("</a>") > 0) {
						newFieldNames = fields[j].substring(fields[j].indexOf('>') + 1, fields[j].lastIndexOf('<'));
						strArray = fields[j].split(newFieldNames);
					} else if (fields[j].indexOf("@TDH") > 0) {
						tdS = "<td style='display:none;'>";
						newFieldNames = fields[j].substring(0, fields[j].indexOf("@TDH"));
					} else if (fields[j].indexOf("?") > 0) {
						var fieldss = fields[j].split("?");
						var jsonStr = fieldss[1];
						jsonStr = jsonStr.replace(/;/g, ",");
						var jsonV = eval('(' + jsonStr + ')');
						for (var e = 0; e < jsonV.length; e++) {
							for ( var key in jsonV[e]) {
								var jvalue = jsonV[e][key];
								if (value == key) {
									value = jvalue;
								}
							}
						}
						newFieldNames = fieldss[0];
					} else if (fields[j].indexOf("^") > 0) {
						var fieldss = fields[j].split("^");
						if ("CDXTCAR" == dataList[i]["partnerNo"]) {
							var jsonStr = fieldss[1];
							jsonStr = jsonStr.replace(/;/g, ",");
							var jsonV = eval('(' + jsonStr + ')');
							for (var e = 0; e < jsonV.length; e++) {
								for ( var key in jsonV[e]) {
									var jvalue = jsonV[e][key];
									if (value == key) {
										value = jvalue;
									}
								}
							}
						} else {
							value = "";
						}
						newFieldNames = fieldss[0];
					} else {
						newFieldNames = fields[j];
					}
					if (fieldNames != null
							&& newFieldNames.toLowerCase() == d.toLowerCase()) {
						if (strArray != null && strArray.length == 2) {
							sHtml = sHtml + tdS + strArray[0] + value + strArray[1] + tdE;
						} else {
							sHtml = sHtml + tdS + value + tdE;
						}
						bool = false;
					} else if (fieldNames == null) {
						sHtml = sHtml + "<td>" + value + "</td>";
					}
				}
			}
			if (null != lastColumnElement) {
				var strArray2 = new Array();
				strArray2 = lastColumnElement.split("@");
				for (var z = 0; z < strArray2.length; z++) {
					var buttonr = strArray2[z];
					buttonr = buttonr.replace(/#/g, value);
					sHtml = sHtml + "<td>" + buttonr + "</td>";
				}
			}
			sHtml = sHtml + tdStr + "</tr>";
		}
	}
	return sHtml;
}
function creatTable10(fieldNames,page,firstColumnElement,lastColumnElement){
	var sHtml = "";
	if(page != null){
		if(page.data == null){
			return "";
		}
		var fields = new Array();
		var fieldsLength = 1;
		if(fieldNames != null){
			fields = fieldNames.split(",");
			fieldsLength = fields.length;
		}
		var dataLength = page.data.length;
		var dataList = page.data;
		var tdS = ""; var tdE = "";


		for(var i=0;i<dataLength;i++){
			sHtml = sHtml+ "<tr>";
			var tdStr = "";
			if(null != firstColumnElement){
				var strArray2 = new Array();
				var value = dataList[i]['TRADPRODCODE'];
				strArray2 = firstColumnElement.split("@");
				for(var z=0;z<strArray2.length;z++){
					var buttonr=strArray2[z];
					buttonr=buttonr.replace(/#/g,value);
					sHtml = sHtml+ "<td>"+buttonr+"</td>";
				}
			}
			for(var j=0;j<fieldsLength;j++){
				for(var d in dataList[i]){
					var value = dataList[i][d];
					if(null==value){value="";}
					var bool = true;
					tdS = "<td>";
					tdE = "</td>";
					var strArray = new Array();
					var newFieldNames = "";
					if(fields[j].indexOf("</a>") > 0){
						newFieldNames = fields[j].substring(fields[j].indexOf('>')+1,fields[j].lastIndexOf('<'));
						strArray = fields[j].split(newFieldNames);
					}else if(fields[j].indexOf("@TDH") > 0){
						tdS = "<td style='display:none;'>";
						newFieldNames = fields[j].substring(0,fields[j].indexOf("@TDH"));
					}else if(fields[j].indexOf("?") > 0){
						var fieldss=fields[j].split("?");
						var jsonStr=fieldss[1];
						jsonStr=jsonStr.replace(/;/g,",");
						var jsonV= eval('('+jsonStr+')');
						for(var e=0;e<jsonV.length;e++){
							for(var key in jsonV[e]){
								var jvalue = jsonV[e][key];
								if(value==key){
									value=jvalue;
								}
							}
						}
						newFieldNames=fieldss[0];

					}else{
						newFieldNames = fields[j];
					}
					if(fieldNames != null && newFieldNames.toLowerCase() == d.toLowerCase()){
						if(strArray != null && strArray.length == 2){
							sHtml = sHtml+tdS+strArray[0]+value+strArray[1]+tdE;
						}else{

							sHtml = sHtml+tdS+value+tdE;
						}
						bool = false;
					}else if(fieldNames == null){
						sHtml = sHtml+ "<td>"+value+"</td>";
					}
				}
			}


			if(null != lastColumnElement){
				var strArray2 = new Array();
				strArray2 = lastColumnElement.split("@");
				for(var z=0;z<strArray2.length;z++){
					var buttonr=strArray2[z];
					buttonr=buttonr.replace(/#/g,value);
					var serialNumber = dataList[i]['serialNumber'] === null? '': dataList[i]['serialNumber']
					buttonr=buttonr.replace('serialNumberVal',serialNumber);
					sHtml = sHtml+ "<td>"+buttonr+"</td>";
				}
			}
			sHtml = sHtml + tdStr + "</tr>";
		}


	}
	return sHtml;
}
//firstColumnElement、lastColumnElement也要支持单元格隐藏
function creatTable11(fieldNames,page,firstColumnElement,lastColumnElement){
	var sHtml = "";
	if(page != null){
		if(page.data == null){
			return "";
		}
		var fields = new Array();
		var fieldsLength = 1;
		if(fieldNames != null){
			fields = fieldNames.split(",");
			fieldsLength = fields.length;
		}
		var dataLength = page.data.length;
		var dataList = page.data;
		var tdS = ""; var tdE = "";
		
		
		for(var i=0;i<dataLength;i++){
			sHtml = sHtml+ "<tr>";
			var tdStr = "";
			if(null != firstColumnElement){
				var strArray2 = new Array(); 
				var value = dataList[i]['TRADPRODCODE'];
				strArray2 = firstColumnElement.split("@");
				for(var z=0;z<strArray2.length;z++){
					var buttonr=strArray2[z];
					buttonr=buttonr.replace(/#/g,value);
					/*if(buttonr.substring(0,3) == 'TDH'){
						sHtml = sHtml+ "<td style='display:none;'>"+buttonr+"</td>";
					}else {
						sHtml = sHtml+ "<td>"+buttonr+"</td>";
					}*/
					sHtml = sHtml+ "<td>"+buttonr+"</td>";
				}
			}
			for(var j=0;j<fieldsLength;j++){
				for(var d in dataList[i]){
					var value = dataList[i][d];
					if(null==value){value="";}
					var bool = true;
					tdS = "<td>"; 
					tdE = "</td>";
					var strArray = new Array(); 
					var newFieldNames = "";
					if(fields[j].indexOf("</a>") > 0){
						newFieldNames = fields[j].substring(fields[j].indexOf('>')+1,fields[j].lastIndexOf('<'));
						strArray = fields[j].split(newFieldNames);
					}else if(fields[j].indexOf("@TDH") > 0){
						tdS = "<td style='display:none;'>";
						newFieldNames = fields[j].substring(0,fields[j].indexOf("@TDH"));
					}else if(fields[j].indexOf("?") > 0){
						var fieldss=fields[j].split("?");
						var jsonStr=fieldss[1];
						jsonStr=jsonStr.replace(/;/g,",");
						var jsonV= eval('('+jsonStr+')');
						for(var e=0;e<jsonV.length;e++){
							for(var key in jsonV[e]){
								var jvalue = jsonV[e][key];
								if(value==key){
									value=jvalue;
								}
							}
						}
						newFieldNames=fieldss[0];
						
					}else{
						newFieldNames = fields[j];
					}
					if(fieldNames != null && newFieldNames.toLowerCase() == d.toLowerCase()){
						if(strArray != null && strArray.length == 2){
							sHtml = sHtml+tdS+strArray[0]+value+strArray[1]+tdE;
						}else{
							
							sHtml = sHtml+tdS+value+tdE;
						}
						bool = false;
					}else if(fieldNames == null){
						sHtml = sHtml+ "<td>"+value+"</td>";
					}
				}
			}

			
			if(null != lastColumnElement){
				var strArray2 = new Array(); 
				
				
				strArray2 = lastColumnElement.split("@");
				for(var z=0;z<strArray2.length;z++){
					var buttonr=strArray2[z];
					var flow=true;
					
					while(flow){
						var start=buttonr.indexOf("{");
						var end =buttonr.indexOf("}");
						var lastval=buttonr.substring(start+1,end);
						var value = dataList[i][lastval];
						if(start>0){
							if(null==value){
								buttonr=buttonr.replace("{"+lastval+"}","");
							}else{
								buttonr=buttonr.replace("{"+lastval+"}",value);
							}
						}else{
							flow=false;
						}
					}
					if(buttonr.substring(0,3) == 'TDH'){
						sHtml = sHtml+ "<td style='display:none;'>"+buttonr.slice(3)+"</td>";
					}else {
						sHtml = sHtml+ "<td>"+buttonr+"</td>";
					}
				}	
			}
			sHtml = sHtml + tdStr + "</tr>";
			
		}
		
		
	}
	return sHtml;
}
